package com.lims.controller;

import com.lims.base.entity.TestUser;
import com.lims.common.BaseResult;
import com.lims.service.ITestUserService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/testUser")
public class TestUserController {
    @Resource
    private ITestUserService testUserService;

    @PostMapping("/getById")
    public BaseResult<TestUser> getById(@RequestBody TestUser req) {
        return BaseResult.success(testUserService.getById(req.getId()));
    }

    /**
     * 接收信息，不做业务处理，推送到kafka
     * @param req
     * @return
     */
    @PostMapping("/receive")
    public BaseResult receive(@RequestBody String req) {
        testUserService.receive(req);
        return BaseResult.success();
    }
}
